<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<h:form id="transFaultForm">
		<div id="headDiv" class="box box-solid with-border">
			<div class="box-header" id="queryDiv">
				<p:outputLabel value="结束时间：" />
				<p:calendar navigator="true" maxdate="Date()"
					value="#{deviceFaultCountController.transStartTime}"
					pattern="yyyy-MM-dd" size="14">
				</p:calendar>
				<p:outputLabel value="至"
					style="margin-right:5px;margin-left:5px;" />
				<p:calendar navigator="true" size="14"
					value="#{deviceFaultCountController.transEndTime}"
					pattern="yyyy-MM-dd" maxdate="Date()">
				</p:calendar>
				<p:commandButton icon="ui-icon-search" value="查询"
					update="transFormersTb" 
					actionListener="#{deviceFaultCountController.initTransformerData}"
					oncomplete="initDataTable();"
					style="margin-left:5px;">
				</p:commandButton>
				<p:commandButton value="详细"
					actionListener="#{deviceFaultCountController.showTransDetaill()}"
					oncomplete="initDataTable();"
					update="transFormersTb" icon="ui-icon-calculator" />
			</div>
		</div>
		<p:dataTable id="transFormersTb" var="trans" scrollWidth="100%"
			value="#{deviceFaultCountController.transFaultUploadInfoDtos}"
			emptyMessage="无记录" style="text-align:center" rows="10"
			paginator="true" paginatorPosition="bottom"
			paginatorTemplate="{Customer} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="10,20,50" scrollable="true">
			<f:facet name="{Customer}">
				<p:outputLabel value="总计：#{deviceFaultCountController.transFaultUploadInfoDtos.size()}条纪录"
					style="margin-right:20px" />
			</f:facet>
			<p:columnGroup type="header">
				<p:row>
					<p:column  rowspan="2" headerText="故障时间" style="width:150px;heigth:50px;" />
					<p:column  rowspan="2" headerText="故障情况" style="width:150px;heigth:50px;" />
					<p:column  rowspan="2" headerText="厂站" style="width:100px;heigth:50px;" />
					<p:column  rowspan="2" headerText="集中录波" style="width:50px;heigth:50px;" />
					<p:column  colspan="2" headerText="主一保护" style="width:100px;heigth:50px;" />
					<p:column  colspan="2" headerText="主二保护" style="width:100px;heigth:50px;" />
					<p:column  colspan="2" headerText="非电量保护" style="width:100px;heigth:50px;" />
					<p:column  colspan="3" headerText="500kV断路器保护一" style="width:600px;heigth:50px;" />
					<p:column  colspan="3" headerText="500kV断路器保护二" style="width:600px;heigth:50px;"/>
					<p:column  colspan="3" style="width:700px;heigth:50px;"  headerText="220kV断路器保护一" rendered="#{deviceFaultCountController.showTransDetail}" />
				    <p:column  rowspan="2" headerText="综合上报完好率"  style="width:50px;heigth:50px;"/>
					<p:column  rowspan="2" headerText="保护事件完好率"  style="width:50px;heigth:50px;"/>
					<p:column  rowspan="2" headerText="保护录波完好率"  style="width:50px;heigth:50px;"/>
					<p:column  rowspan="2" headerText="集中录波完好率"  style="width:50px;heigth:50px;"/>
				</p:row>
				<p:row>
					<p:column headerText="报文" />
					<p:column headerText="录波" />
					<p:column headerText="报文" />
					<p:column headerText="录波" />
					<p:column headerText="报文" />
					<p:column headerText="录波" />
	
					<p:column headerText="名称" />
					<p:column headerText="报文" />
					<p:column headerText="录波" />
					<p:column headerText="名称" />
					<p:column headerText="报文" />
					<p:column headerText="录波" />
					<p:column headerText="名称" rendered="#{deviceFaultCountController.showTransDetail}" />
					<p:column headerText="报文" rendered="#{deviceFaultCountController.showTransDetail}" />
					<p:column headerText="录波" rendered="#{deviceFaultCountController.showTransDetail}" />
				</p:row>
			</p:columnGroup>
			<p:column>
				<p:outputLabel>#{deviceFaultCountController.formatterDate(trans.faultTime)}</p:outputLabel>
			</p:column>
			<p:column>
				<p:outputLabel id="faultDeviceLabel">#{trans.faultDesc}</p:outputLabel>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;" value="#{s.stationName}" />
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.waveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.waveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.main1DatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.main1DatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.main1WaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.main1WaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.main2DatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.main2DatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
	
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.main2WaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.main2WaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.nonElectricityProtectionDatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.nonElectricityProtectionDatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.nonElectricityProtectionWaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.nonElectricityProtectionWaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel title="#{s.breakerProtect1Name}">#{s.breakerProtect1Name}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect1DatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect1DatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect1WaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect1WaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel title="#{s.breakerProtect2Name}">#{s.breakerProtect2Name}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect2DatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect2DatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column>
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect2WaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect2WaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column rendered="#{deviceFaultCountController.showTransDetail}">
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel title="#{s.breakerProtect3Name}">#{s.breakerProtect3Name}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column rendered="#{deviceFaultCountController.showTransDetail}">
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect2DatagramInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect3DatagramInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column rendered="#{deviceFaultCountController.showTransDetail}">
				<ui:repeat var="s" value="#{trans.stationInfo}">
					<p:outputLabel style="width:100%;height:50%;"
						styleClass="#{s.breakerProtect2WaveInfo!=-1 ? 'autoUpload':'failedUpload'}">#{deviceFaultCountController.getCentralizedStr(s.breakerProtect3WaveInfo)}</p:outputLabel>
				</ui:repeat>
			</p:column>
			<p:column  >
				<p:outputLabel id="faultDeviceLabel0" value="#{trans.totalIntactRate}%"/>
			</p:column>
			<p:column  >
				<p:outputLabel id="faultDeviceLabel2" value="#{trans.protectEventIntactRate}%" />
			</p:column>
			<p:column  >
				<p:outputLabel id="faultDeviceLabel3"  value="#{trans.protectWaveIntactRate}%"/>
			</p:column>
			<p:column  >
				<p:outputLabel id="faultDeviceLabel4" value="#{trans.centralWave}%"/>
			</p:column>
		</p:dataTable>
	</h:form>
</ui:composition>
